Provide a new viewer for the Restore from Local History action #1879 #1880
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1879
The new viewer implementation is used when the viewer factory is invoked without a compare configuration. This is the case when it is called from the Restore from Local History action. The existing merge viewer cannot be used in this situation.
Implementation notes:
Normally a custom
IEditorInput
implementation is not needed and creating a document withnew Document(contentString)
would be enough.But here, tm4e needs a file buffer or an editor input object derived from
IStorageEditorInput
in order to determine the content type (see: ContentTypeHelper.java#L55-L63). So theHistoryInput
object from the Eclipse platform has to be adapted toIStorageEditorInput
in this viewer implementation.